import 'package:dog_miao/frame/bottomNavs.dart';
import 'package:dog_miao/main/index.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:dog_miao/routes/index.dart';

class Frame extends StatefulWidget {
  Frame({Key key}): super(key: key);

  @override
  _Frame createState() => _Frame();
}

class _Frame extends State<Frame> {
  int currentKey = 0;

  void setCurrentKey(key){
    setState(() {
      currentKey = key;
    });
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: "dog喵",
      home: Scaffold(
        body: Main(currentKey: currentKey),
        bottomNavigationBar: BottomNav(currentKey: currentKey, setCurrentKey: setCurrentKey, ),
      ),
      routes: {
        ...routes
      },
    );
  }
}